/**
 * 
 */
package Offer;

import java.util.ArrayList;

import Player.Player;
import Square.Negotiable;

/**
 * @author Avia Tam
 * @author Assaf Miron
 *
 */
public class Asset_Offer extends Offer {
	private ArrayList<Negotiable>asset;

	/**
	 * @param offer_player
	 * @param asset
	 */
	public Asset_Offer(Player offer_player, ArrayList<Negotiable>asset) {
		super(offer_player);
		this.asset = asset;
	}
	
	//returns the asset thats being offered by player
	public ArrayList<Negotiable> getAssetOffer(){
		return asset;
	}
		
	public String getName()
	{
		// Check if the Asset to sell is a group or a unit
		if(asset.size() == 1)
			// The asset is a unit  - return its name
			return asset.get(0).getName();
		else
			// The asset is a group - return its name
			return asset.get(0).getGroup().getName();
	}
	
	@Override
	public String toString() 
	{
		return getName() + " (" + getPlayer().getName() + ")";
	}

	@Override
	//returns the offer type
	public OfferType getOfferType() {
		return OfferType.ASSET_OFFER;
	}
	
}
